﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;

namespace WMS_Api.Areas.MesSystem.Models
{
    /// <summary>
    ///  MES 物料信息
    /// </summary>
    public class MesMaterialInfoModel
    {
        /// <summary>
        /// 物料编码
        /// </summary>
        [Required(ErrorMessage = "物料编码不允许为空!")]
        public string part_no { get; set; }

        /// <summary>
        /// 物料名称
        /// </summary>
        [Required(ErrorMessage = "物料名称不允许为空!")]
        public string part_name { get; set; }

        /// <summary>
        /// 版本
        /// </summary>
        public string version { get; set; }

        /// <summary>
        /// 规格型号，包含特殊字符、空格等
        /// </summary>
        public string spec { get; set; }

        /// <summary>
        /// 材质
        /// </summary>
        public string material { get; set; }

        /// <summary>
        /// 单位
        /// </summary>
        public string unit { get; set; }

        /// <summary>
        /// 外径
        /// </summary>
        public string out_diam { get; set; }

        /// <summary>
        /// 长度
        /// </summary>
        public string length { get; set; }

        /// <summary>
        /// 物料状态：0：停用，4：启用
        /// </summary>
        public int part_status { get; set; }

        /// <summary>
        /// 材料属性;0：焊接, 1：组装
        /// </summary>
        public int material_property { get; set; }

        /// <summary>
        /// 安全库存
        /// </summary>
        //[Required(ErrorMessage = "安全库存不允许为空!")]
        public string safety_inventory { get; set; }

        /// <summary>
        /// 是否常用;0：常用, 1：不常用
        /// </summary>
        [Range(0, 1, ErrorMessage = "是否常用common值为0或者1")]
        public int common { get; set; }

        /// <summary>
        /// 物料类型 0：原料，1：半成品，2：成品
        /// </summary>
        public int part_type { get; set; }

        /// <summary>
        /// 描述
        /// </summary>
        public string description { get; set; }

        /// <summary>
        /// 创建时间（unix时间戳）精确到毫秒-13位的
        /// </summary>
        [RegularExpression(@"^\d{13}$", ErrorMessage = "创建时间create_time为13位的时间戳!")]
        public long create_time { get; set; }
    }

    /// <summary>
    /// 
    /// </summary>
    public class MesMaterialInfoExtendModel : BaseInfoModel
    {
        /// <summary>
        /// 
        /// </summary>
        public List<MesMaterialInfoModel> data { get; set; }
    }
}